package cn.no7player.service;

import cn.no7player.mapper.UserMapper;
import cn.no7player.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by zl on 2015/8/27.
 */

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public User getUserInfo(){
        User user=userMapper.findUserInfo();
        //User user=null;
        return user;
    }

    public Boolean login(User user){

       User user1 =  userMapper.findByUsername(user.getUsername());
//        User user1 = new User();
//        user1.setUsername("zhangsan");
//        user1.setPassword("123");
        if (user1 != null){
            if (user.getPassword().equals(user1.getPassword())){
                return  true;
            }
        }
      return false;
    }


}
